<!DOCTYPE html>
<html lang="en">
  <head>
    {% block head %} {% block meta %}
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="shortcut icon" href="{{ url_for('static', filename='img/logo.png') }}" />
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="google" content="notranslate" />
    {% endblock meta %}
    <title>eNMS | {% block title %}{% endblock %}</title>
    {% block stylesheets %}
    <link
      href="{{ url_for('static', filename='lib/bootstrap/css/bootstrap.min.css') }}"
      rel="stylesheet"
    />
    <link
      href="{{ url_for('static', filename='lib/bootstrap-toggle/bootstrap-toggle.min.css') }}"
      rel="stylesheet"
    />
    <link
      href="{{ url_for('static', filename='lib/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css') }}"
      rel="stylesheet"
    />
    <link
      href="{{ url_for('static', filename='lib/full_calendar/fullcalendar.min.css') }}"
      rel="stylesheet"
    />
    <link
      href="{{ url_for('static', filename='lib/bootstrap-select/bootstrap-select.min.css') }}"
      rel="stylesheet"
    />
    <link
      href="{{ url_for('static', filename='lib/bootstrap-slider/bootstrap-slider.min.css') }}"
      rel="stylesheet"
    />
    <link
      href="{{ url_for('static', filename='lib/nprogress/nprogress.min.css') }}"
      rel="stylesheet"
    />
    <link
      href="{{ url_for('static', filename='lib/alertify/alertify.min.css') }}"
      rel="stylesheet"
    />
    <link
      href="{{ url_for('static', filename='lib/difflib/diff2html.min.css') }}"
      rel="stylesheet"
    />
    <link
      href="{{ url_for('static', filename='lib/datatables/dataTables.bootstrap.min.css') }}"
      rel="stylesheet"
    />
    <link
      href="{{ url_for('static', filename='lib/jspanel/jspanel.min.css') }}"
      rel="stylesheet"
    />
    <link
      href="{{ url_for('static', filename='lib/font-awesome/font-awesome.min.css') }}"
      rel="stylesheet"
    />
    <link
      href="{{ url_for('static', filename='lib/jsoneditor/jsoneditor.min.css') }}"
      rel="stylesheet"
    />
    <link
      href="{{ url_for('static', filename='lib/codemirror/codemirror.min.css') }}"
      rel="stylesheet"
    />
    <link
      href="{{ url_for('static', filename='lib/select2/select2.min.css') }}"
      rel="stylesheet"
    />
    <link
      href="{{ url_for('static', filename='lib/jstree/themes/style.min.css') }}"
      rel="stylesheet"
    />
    <link
      href="{{ url_for('static', filename='lib/dropzone/dropzone.min.css') }}"
      rel="stylesheet"
    />
    <link href="{{ url_for('static', filename='css/main.css') }}" rel="stylesheet" />
    <link
      href="{{ url_for('static', filename='css/themes/{}.css'.format(current_user.theme)) }}"
      rel="stylesheet"
    />
    {% endblock stylesheets %} {% endblock head %}
  </head>
  {% block body %} {% set menu_class = "nav-sm" if current_user.small_menu else "nav-md"
  %}
  <body class="{{ menu_class }}">
    {% block sidebar %}
    <div id="sidebar" class="left_column">
      <center>
        {% set logo_size = "17" if current_user.small_menu else "30" %}
        <h3 id="eNMS" class="logo unselectable" style="font-size:{{ logo_size }}px">
          eNMS
        </h3>
        <img
          id="img-enms"
          src="{{ url_for('static', filename='img/logo.png') }}"
          style="width: 30px; display: none;"
        />
        {% set version_size = "15" if current_user.small_menu else "20" %}
        <h3
          id="eNMS-version"
          class="version unselectable"
          style="font-size: {{ version_size }}px;"
        >
          v{{ version }}
        </h3>
      </center>
      <div id="sidebar-menu" class="hidden-print main_menu">
        <div class="menu_section">
          <ul class="nav side-menu">
            {% for label, category in rbac["menu"].items() %} {% if user.is_admin or
            label in user.menu or category["rbac"] == "all" %}
            <li>
              <a
                ><i class="fa fa-{{ category['icon'] }}"></i>{{ label }}
                <span class="fa fa-chevron-down"></span>
              </a>
              <ul class="nav child_menu">
                {% for page, data in category["pages"].items() %} {% if user.is_admin or
                page in user.pages or data["rbac"] == "all" %} {% if "subpages" in data
                %}
                <li>
                  <a>{{ page }}<span class="fa fa-chevron-down"></span></a>
                  <ul class="nav child_menu">
                    {% for subpage, subpage_values in data["subpages"].items() %} {% if
                    user.is_admin or subpage in user.pages or subpage_values["rbac"] ==
                    "all" %}
                    <li>
                      <a href="{{ subpage_values['endpoint'] }}">{{ subpage }}</a>
                    </li>
                    {% endif %} {% endfor %}
                  </ul>
                </li>
                {% else %}
                <li><a href="{{ data['endpoint'] }}">{{ page }}</a></li>
                {% endif %} {% endif %} {% endfor %}
              </ul>
            </li>
            {% endif %} {% endfor %}
          </ul>
        </div>
      </div>
      {% set font, left = (8, 5) if current_user.small_menu else (11, 10) %}
      <div
        id="server-time"
        style="font-size: {{ font }}px; left: {{ left }}px"
        class="server-time"
      >
        {% if not current_user.small_menu %} Server Time: {{ time }} {% else %} {% set
        a, b = time.split(" ") %} {{ a }} <br />
        {{ b }} {% endif %}
      </div>
    </div>
    {% endblock sidebar %} {% block header %}
    <div class="right_column">
      <div class="header">
        <div class="top_nav">
          <div class="nav_menu">
            <nav>
              <div class="nav toggle">
                <a id="menu_toggle"><i class="fa fa-bars"></i></a>
              </div>
              <div class="nav toggle">
                <a onclick="eNMS.base.fullScreen()"
                  ><i class="glyphicon glyphicon-fullscreen"></i
                ></a>
              </div>
              <ul class="nav navbar-nav navbar-right">
                <li class="nav-item">
                  <a
                    href="javascript:;"
                    class="user-profile dropdown-toggle"
                    data-toggle="dropdown"
                    aria-expanded="false"
                  >
                    <img src="{{ url_for('static', filename='img/logo.png') }}" />
                    {{ current_user.name }}
                    <span class="fa fa-angle-down"></span>
                  </a>
                  <ul class="dropdown-menu dropdown-usermenu pull-right">
                    <li>
                      <a onclick="eNMS.administration.showProfile()"
                        ><i class="fa fa-user pull-right"></i>Profile</a
                      >
                    </li>
                    <li>
                      <a href="/logout"
                        ><i class="fa fa-sign-out pull-right"></i>Log out</a
                      >
                    </li>
                  </ul>
                </li>
                <li class="nav-item">
                  <a
                    href="javascript:;"
                    class="user-profile dropdown-toggle"
                    data-toggle="dropdown"
                    aria-expanded="false"
                  >
                    <img src="{{ url_for('static', filename='img/theme.png') }}" />
                    Theme
                    <span class="fa fa-angle-down"></span>
                  </a>
                  <ul class="dropdown-menu dropdown-usermenu pull-right">
                    {% for theme, values in themes["themes"].items() %}
                    <li>
                      <a onclick="eNMS.base.switchTheme('{{ theme }}')"
                        >{{ values["name"] }}</a
                      >
                    </li>
                    {% endfor %}
                  </ul>
                </li>
                <li role="presentation" class="nav-item dropdown">
                  <a
                    onclick="eNMS.base.createAlerts()"
                    class="dropdown-toggle info-number"
                    style="cursor: pointer;"
                    data-toggle="dropdown"
                    aria-expanded="false"
                  >
                    <span class="fa fa-envelope-o f fa-2x"></span>
                    <span id="alert-number" class="badge"></span>
                    &nbsp;Alerts
                  </a>
                  <ul
                    id="alerts"
                    class="dropdown-menu list-unstyled msg_list"
                    role="menu"
                  ></ul>
                </li>
                <li class="nav-item">
                  <a
                    target="_blank"
                    href="{{ settings['app']['documentation_url'] }}{{ settings['docs'][endpoint] }}"
                  >
                    <img
                      src="{{ url_for('static', filename='img/readthedocs.png') }}"
                      height="25"
                      width="25"
                    />
                    &nbsp;Docs
                  </a>
                </li>
                <li class="nav-item">
                  <a
                    onclick="eNMS.administration.displayFiles()"
                    style="cursor: pointer;"
                  >
                    <img
                      src="{{ url_for('static', filename='img/files.png') }}"
                      height="25"
                      width="25"
                    />
                    &nbsp;Files
                  </a>
                </li>
                {% if user.is_admin %}
                <li class="nav-item">
                  <a
                    onclick="eNMS.base.openPanel({
                      name: 'administration', title: 'Administration Panel', size: 'auto'
                      })"
                    style="cursor: pointer;"
                  >
                    <img
                      src="{{ url_for('static', filename='img/administration.png') }}"
                      height="25"
                      width="25"
                    />
                    &nbsp;Admin
                  </a>
                </li>
                {% endif %}
              </ul>
            </nav>
          </div>
        </div>
      </div>
      {% endblock header %}
      <div class="main_frame">
        {% block content %} {% endblock content %}
      </div>
    </div>
    {% endblock body %} {% block javascripts %}
    <script src="{{ url_for('static', filename='lib/jquery/jquery.min.js') }}"></script>
    <script>
      window.eNMS = {};
      const applicationPath = {{ application_path|d("")|tojson|safe }};
      const filePath = {{ file_path|tojson|safe }};
      const page = "{{ endpoint }}";
      const linkPath = {{ link_path|d("")|tojson|safe }};
      const linkRuntime = {{ link_runtime|d("")|tojson|safe }};
      const user = {{ user|tojson|safe }};
      const automation = {{ automation|tojson|safe }};
      const configurationProperties = {{ configuration_properties|tojson|safe }};
      const formProperties = {{ form_properties|tojson|safe }};
      const names = {{ names|tojson|safe }};
      const parameters = {{ parameters|tojson|safe }};
      const relationships = {{ relationships|tojson|safe }};
      const serverUrl = {{ server_url|tojson|safe }};
      const subtypes = {{ subtypes|tojson|safe }};
      const tableProperties = {{ table_properties|tojson|safe }};
      const theme = {{ themes|tojson|safe }}.themes?.[user.theme];
      const visualization = {{ visualization|tojson|safe }};
      const rbac = {{ rbac|tojson|safe }};
      let action = {};
      let settings = {{ settings|tojson|safe }};
      let csrf_token = "{{ csrf_token() }}";
    </script>
    <script src="{{ url_for('static', filename='lib/moment/moment.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/full_calendar/fullcalendar.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/bootstrap/bootstrap.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/bootstrap-toggle/bootstrap-toggle.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/bootstrap-select/bootstrap-select.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/bootstrap-slider/bootstrap-slider.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/datatables/jquery.dataTables.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/datatables/dataTables.bootstrap.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/nprogress/nprogress.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/alertify/alertify.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/smart-wizard/smart-wizard.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/difflib/diff2html.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/difflib/diff2html-ui.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/jspanel/jspanel.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/jspanel/jspanel.tooltip.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/jspanel/jspanel.hint.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/jsoneditor/jsoneditor.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/codemirror/codemirror.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/codemirror/logsMode.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/select2/select2.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/jstree/jstree.min.js') }}"></script>
    <script src="{{ url_for('static', filename='lib/dropzone/dropzone.min.js') }}"></script>
    <script type="module" src="{{ url_for('static', filename='js/base.js') }}"></script>
    {% endblock %}
  </body>
</html>
